import React, { ReactNode } from 'react';

interface IVTextProps {
  tag: string;
  text: ReactNode;
  style?: React.CSSProperties;
  componentProps?: any;
  extra?: any;
  [key: string]: any;
}

const VText: React.FC<IVTextProps> = props => {
  const { tag = 'div', text, style, extra } = props;
  return React.createElement(
    tag,
    { className: 'v-text-wrapper', style: style, ...extra },
    text,
  );
};

export default VText;
